package com.SuanFa.lanqiao;

import java.util.*;

public class a12 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int i = scan.nextInt();
        int[][] nums = new int[i][5];
        for (int j = 0; j < i; j++) {
            for (int k = 0; k < 5; k++) {
                nums[j][k] = scan.nextInt();
            }
            nums[j][0] *= 2;
            nums[j][1] *= 3;
            nums[j][2] *= 4;
        }
        for (int j = 0; j < i; j++) {
            //六人桌
            int b6 = nums[j][3];
            if (b6 > 0) {
                int a2 = nums[j][0];
                int a3 = nums[j][1];
                int a4 = nums[j][2];
                if ( a2> 0) {
                    int i1 = b6 / a2;
                }
                if ( a3> 0) {
                    int i1 = b6 / a3;
                }
                if (a4 > 0) {
                    int i1 = b6 / a4;
                }

            }
        }


        scan.close();
    }
}
